------------------------------------------------------------------------------------------------------
       log:  C:\DATA\electoral_xtpcse.log
  log type:  text
 opened on:  18 May 2005, 11:00:57

.  #delimit ;
delimiter now ;
. *     ***************************************************************** *;
. *     ***************************************************************** *;
. *       File-Name:      electoral_xtpcse.do                             *;
. *       Date:           5/18/05                                         *;
. *       Author:         MRG                                             *;
. *       Purpose:        Do-file to replicate results for AJPS version   *;
. *                       of presidential candidates paper where          *;
. *                       dependent variable is electoral parties.        *;
. *                       Use XTPCSE etc.                                 *;
. *       Input File:     legislative_newp.dta                            *;
. *       Output File:    electoral_xtpcse.log                            *;
. *       Data Output:    None                                            *;
. *       Previous file:                                                  *;
. *       Machine:        Home                                            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. set mem 10m;
(10240k)

. set matsize 150;

. *     ****************************************************************  *;
. *       First, do Amorim Neto and Cox in the 1980s                      *;
. *     ****************************************************************  *;
. use c:\ajps\coxappend.dta;

. regress enpv proximit enpres proxpres eneth lnml lmleneth if drop==0, robust;

Regression with robust standard errors                 Number of obs =      51
                                                       F(  6,    44) =   33.77
                                                       Prob > F      =  0.0000
                                                       R-squared     =  0.6821
                                                       Root MSE      =  1.0654

------------------------------------------------------------------------------
             |               Robust
        enpv |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
    proximit |  -5.870379    1.30652    -4.49   0.000    -8.503496   -3.237262
      enpres |   .2064884   .2675578     0.77   0.444     -.332739    .7457157
    proxpres |   1.760122   .7465159     2.36   0.023     .2556183    3.264626
       eneth |  -.0849393   .2043377    -0.42   0.680    -.4967549    .3268763
        lnml |  -.3653744   .3538143    -1.03   0.307     -1.07844    .3476914
    lmleneth |   .6067504   .2697689     2.25   0.030     .0630669    1.150434
       _cons |   2.756443   .4063037     6.78   0.000     1.937592    3.575295
------------------------------------------------------------------------------

. clear;

. use c:\ajps\legislative_newp.dta;

. *     ****************************************************************  *;
. *                           Summary Statistics                          *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       867     100.083    39.39866          3        199
        year |       867    1978.435    16.12735       1946       2000
 institution |       867    1.720877    .8967816          1          3
     legelec |       867           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       867    .2226067    .4162364          0          1
      regime |       867    .0207612    .1426664          0          1
  regime_leg |       867           0           0          0          0
    eighties |       867    .0784314    .2690044          0          1
    nineties |       867    .1314879    .3381282          0          1
-------------+--------------------------------------------------------
         old |       867    .8662053    .3406281          0          1
      avemag |       843     11.2979    27.15588          1        150
   districts |       844    92.96682    141.6076          1        659
        eneg |       708    1.941652    1.227505   1.004012   14.22434
        enep |       791    3.878951    1.857447          1      14.89
-------------+--------------------------------------------------------
 enep_others |       788    3.154099    7.559339          0       69.3
       enep1 |       788    4.273211    3.811859          1      57.56
        enpp |       826    3.573923    3.853006          1      52.42
 enpp_others |       815    1.599509    6.055805          0         86
       enpp1 |       814    3.934066    7.452793          1     178.65
-------------+--------------------------------------------------------
      enpres |       858    1.186659    1.595493          0       6.57
      medmag |       702    12.72009    29.69172          1        150
      newdem |       867    .1534025    .3605831          0          1
  proximity1 |       867    .2918454    .4175579          0          1
  proximity2 |       867    .2214533    .4154646          0          1
-------------+--------------------------------------------------------
       seats |       860     201.943    163.7675         10        672
  upperseats |       817    14.89229    45.95744          0        344
   uppertier |       817    5.632791    12.65088          0      77.95
twoelections |       867    .0207612    .1426664          0          1
twoelectio~1 |       867    .0103806    .1014136          0          1
-------------+--------------------------------------------------------
pres_plura~y |       867    .0968858     .295973          0          1
 pres_runoff |       867    .2064591    .4049974          0          1
pres_major~y |       867    .0588235    .2354299          0          1
pres_qualm~y |       867    .0403691    .1969369          0          1
    pres_stv |       867    .0034602    .0587556          0          1
-------------+--------------------------------------------------------
pres_college |       867    .0230681    .1502063          0          1

. *     ****************************************************************  *;
. *       Note that observations on fractionalization do not equal the    *;
. *       number of observations on eneg. This is because Papua New       *;
. *       Guinea is coded as missing for eneg since there is perfect      *;
. *       fractionalization.  This is based on Fearon's dataset.          *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                    Relabel and Define Variables                       *;
. *     ****************************************************************  *;
. label var country  "countryname";

. label var newdem "first election as new democracy";

. label var countrynumber "countrynumber";

. label var year "year";

. label var regime "regime as of 31 December of given year 0=democracy 1=dictatorship";

. label var regime_leg "regime type at time of legislative election 0 = democracy 1=dictatorship";

. label var legelec "legislative election";

. label var preselec "presidential election";

. label var eighties "election in 1980s closest to 1985";

. label var old "elections in countries that did not transition to democracy in 1990s";

. label var nineties "elections in 1990s closest to 1995";

. label var proximity1 "proximity - continuous";

. label var proximity2 "proximity - dichotomous";

. label var enpp "parliamentary parties - uncorrected";

. label var enpp1 "parliamentary parties - corrected";

. label var enep "electoral parties - uncorrected";

. label var enep1 "electoral parties - corrected";

. label var enpres "effective number of presidential candidates";

. label var seats "assembly size";

. label var districts "number of electoral districts";

. label var avemag "average district magnitude";

. label var medmag "median district magnitude";

. label var upperseats "number of uppertier seats";

. label var uppertier "percentage of uppertier seats";

. label var eneg "effective number of ethnic groups  fearon";

. describe;

Contains data from c:\ajps\legislative_newp.dta
  obs:           867                          
 vars:            36                          24 May 2004 14:36
 size:        96,237 (99.1% of memory free)
-------------------------------------------------------------------------------
              storage  display     value
variable name   type   format      label      variable label
-------------------------------------------------------------------------------
country         str31  %31s                   countryname
countrynumber   int    %8.0g                  countrynumber
year            int    %8.0g                  year
institution     byte   %8.0g                  
legelec         byte   %8.0g                  legislative election
preselec        byte   %8.0g                  presidential election
regime          byte   %8.0g                  regime as of 31 December of
                                                given year 0=democracy
                                                1=dictatorship
regime_leg      byte   %8.0g                  regime type at time of
                                                legislative election 0 =
                                                democracy 1=dictatorship
eighties        byte   %8.0g                  election in 1980s closest to
                                                1985
nineties        byte   %8.0g                  elections in 1990s closest to
                                                1995
old             byte   %8.0g                  elections in countries that did
                                                not transition to democracy in
                                                1990s
avemag          float  %9.0g                  average district magnitude
districts       int    %8.0g                  number of electoral districts
eneg            float  %9.0g                  effective number of ethnic
                                                groups  fearon
enep            float  %9.0g                  electoral parties - uncorrected
enep_others     float  %9.0g                  
enep1           float  %9.0g                  electoral parties - corrected
enpp            float  %9.0g                  parliamentary parties -
                                                uncorrected
enpp_others     float  %9.0g                  
enpp1           float  %9.0g                  parliamentary parties -
                                                corrected
enpres          float  %9.0g                  effective number of
                                                presidential candidates
medmag          float  %9.0g                  median district magnitude
newdem          byte   %8.0g                  first election as new democracy
proximity1      float  %9.0g                  proximity - continuous
proximity2      byte   %8.0g                  proximity - dichotomous
seats           int    %8.0g                  assembly size
upperseats      int    %8.0g                  number of uppertier seats
uppertier       float  %9.0g                  percentage of uppertier seats
twoelections    byte   %8.0g                  
twoelections1   byte   %8.0g                  
pres_plurality  byte   %8.0g                  
pres_runoff     byte   %8.0g                  
pres_majority   byte   %8.0g                  
pres_qualmajo~y byte   %8.0g                  
pres_stv        byte   %8.0g                  
pres_college    byte   %8.0g                  
-------------------------------------------------------------------------------
Sorted by:  

. *     ****************************************************************  *;
. *       Would like to drop countries that have no recognizable parties  *;
. *       since I am interested in determining the number of parties.     *;
. *       Drop Kiribati, Marshall Islands, Micronesia, Nauru, Palau,      *;
. *       Lebanon (at least no votes by party), Kyrgzstan.                *;
. *       Since I am interested in competitive elections I drop the       *;
. *       elections that occurred in Colombia between 1958 and 1970 due   *;
. *       to a constitutional agreement to share power between the        *;
. *       conservative and liberal parties.                               *;
. *       Also drop the Congolese elections of 1963.  Although there were *;
. *       multiple parties permitted, all candidates ran on a single list.*;
. *       Thus, there was no actual competition in this election.         *;
. *     ****************************************************************  *;
. drop if countrynumber==163;
(6 observations deleted)

. drop if countrynumber==165;
(2 observations deleted)

. drop if countrynumber==197;
(3 observations deleted)

. drop if countrynumber==189;
(5 observations deleted)

. drop if countrynumber==146;
(12 observations deleted)

. drop if countrynumber==198;
(2 observations deleted)

. drop if countrynumber==167;
(8 observations deleted)

. drop if countrynumber==70 & year==1958;
(1 observation deleted)

. drop if countrynumber==70 & year==1960;
(1 observation deleted)

. drop if countrynumber==70 & year==1962;
(1 observation deleted)

. drop if countrynumber==70 & year==1964;
(1 observation deleted)

. drop if countrynumber==70 & year==1966;
(1 observation deleted)

. drop if countrynumber==70 & year==1968;
(1 observation deleted)

. drop if countrynumber==70 & year==1970;
(1 observation deleted)

. drop if countrynumber==12 & year==1963;
(1 observation deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       821     97.3715    37.35025          3        199
        year |       821     1978.35    16.15197       1946       2000
 institution |       821    1.719854    .8927666          1          3
     legelec |       821           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       821    .2180268    .4131574          0          1
      regime |       821    .0207065    .1424866          0          1
  regime_leg |       821           0           0          0          0
    eighties |       821    .0803898    .2720614          0          1
    nineties |       821    .1315469    .3382035          0          1
-------------+--------------------------------------------------------
         old |       821    .8733252    .3328111          0          1
      avemag |       804    11.72699    27.73206          1        150
   districts |       805    96.60373    143.9838          1        659
        eneg |       690    1.889245    1.181049   1.004012   14.22434
        enep |       782    3.878018    1.860428       1.23      14.89
-------------+--------------------------------------------------------
 enep_others |       779    3.171412    7.596386          0       69.3
       enep1 |       779    4.276418    3.829688       1.23      57.56
        enpp |       808     3.23625    1.470687          1      10.87
 enpp_others |       797    1.440527    4.762796          0       54.1
       enpp1 |       796    3.322802    1.756047          1      20.94
-------------+--------------------------------------------------------
      enpres |       815     1.21214    1.616311          0       6.57
      medmag |       664    13.30422    30.42178          1        150
      newdem |       821    .1534714     .360661          0          1
  proximity1 |       821    .2911449    .4150291          0          1
  proximity2 |       821    .2168088    .4123225          0          1
-------------+--------------------------------------------------------
       seats |       814    210.0037    164.1061         11        672
  upperseats |       778    15.61954    46.97577          0        344
   uppertier |       778    5.883021    12.88335          0      77.95
twoelections |       821    .0219245    .1465263          0          1
twoelectio~1 |       821    .0109622    .1041887          0          1
-------------+--------------------------------------------------------
pres_plura~y |       821     .090134    .2865482          0          1
 pres_runoff |       821    .2131547    .4097857          0          1
pres_major~y |       821    .0572473    .2324561          0          1
pres_qualm~y |       821    .0426309    .2021468          0          1
    pres_stv |       821    .0036541    .0603752          0          1
-------------+--------------------------------------------------------
pres_college |       821    .0243605    .1542598          0          1

. *     ****************************************************************  *;
. *       Does it matter if I use avemag instead of medmag?               *;
. *     ****************************************************************  *;
. correlate avemag medmag;
(obs=664)

             |   avemag   medmag
-------------+------------------
      avemag |   1.0000
      medmag |   0.9981   1.0000


. correlate avemag medmag if avemag~=1;
(obs=373)

             |   avemag   medmag
-------------+------------------
      avemag |   1.0000
      medmag |   0.9981   1.0000


. *     ****************************************************************  *;
. *       Correlation is extremely high in both cases i.e. greater than   *;
. *       99%.                                                            *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *       Generate interaction variables ready for regressions.           *;
. *     ****************************************************************  *;
. generate logmag=ln(avemag);
(17 missing values generated)

. generate uppertier_eneg = uppertier*eneg;
(173 missing values generated)

. generate logmag_eneg = logmag*eneg;
(148 missing values generated)

. generate proximity1_enpres = proximity1*enpres;
(6 missing values generated)

. *     ****************************************************************  *;
. *       Need to drop elections that use a fused vote in legislative     *;
. *       and presidential elections.                                     *;
. *       Drop Bolivia, Uruguay, Honduras up to and including the 1993    *;
. *       elections, Guatemala elections in 1990 (fused vote with         *;
. *       national district), Dominican Republic elections in 1966, 1970, *;
. *       1974 and 1986.                                                  *;
. *     ****************************************************************  *;
. drop if countrynumber==67;
(6 observations deleted)

. drop if countrynumber==76;
(10 observations deleted)

. drop if countrynumber==59 & year==1957;
(1 observation deleted)

. drop if countrynumber==59 & year==1971;
(1 observation deleted)

. drop if countrynumber==59 & year==1985;
(1 observation deleted)

. drop if countrynumber==59 & year==1989;
(1 observation deleted)

. drop if countrynumber==59 & year==1993;
(1 observation deleted)

. drop if countrynumber==57 & year==1990;
(1 observation deleted)

. drop if countrynumber==54 & year==1966;
(1 observation deleted)

. drop if countrynumber==54 & year==1970;
(1 observation deleted)

. drop if countrynumber==54 & year==1974;
(1 observation deleted)

. drop if countrynumber==54 & year==1986;
(1 observation deleted)

. *     ****************************************************************  *;
. *       Drop those countries where enep1 others are greater than 15% of *;
. *       the vote or seats.                                              *;
. *     ****************************************************************  *;
. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       795    98.37987    37.49907          3        199
        year |       795    1978.405    16.17628       1946       2000
 institution |       795    1.677987    .8761928          1          3
     legelec |       795           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       795    .1924528    .3944749          0          1
      regime |       795    .0201258     .140519          0          1
  regime_leg |       795           0           0          0          0
    eighties |       795    .0779874    .2683206          0          1
    nineties |       795    .1320755    .3387859          0          1
-------------+--------------------------------------------------------
         old |       795    .8691824    .3374131          0          1
      avemag |       780    10.67815    26.32788          1        150
   districts |       781    99.17414    145.3965          1        659
        eneg |       668    1.885193    1.181399   1.004012   14.22434
        enep |       756    3.901045    1.872577       1.23      14.89
-------------+--------------------------------------------------------
 enep_others |       755     3.25645    7.698141          0       69.3
       enep1 |       755    4.307722    3.878852       1.23      57.56
        enpp |       782    3.248376    1.483183          1      10.87
 enpp_others |       772    1.487176    4.832215          0       54.1
       enpp1 |       771    3.336381    1.774226          1      20.94
-------------+--------------------------------------------------------
      enpres |       790    1.150055    1.589989          0       6.57
      medmag |       643    12.05365    28.96131          1        150
      newdem |       795    .1484277    .3557472          0          1
  proximity1 |       795    .2679623    .4011204          0          1
  proximity2 |       795     .191195    .3934898          0          1
-------------+--------------------------------------------------------
       seats |       788    213.4581    165.6253         11        672
  upperseats |       752    16.04122    47.66664          0        344
   uppertier |       752    5.992061    12.95682          0      77.95
twoelections |       795    .0226415    .1488514          0          1
twoelectio~1 |       795    .0113208    .1058617          0          1
-------------+--------------------------------------------------------
pres_plura~y |       795    .0716981    .2581498          0          1
 pres_runoff |       795     .208805    .4067107          0          1
pres_major~y |       795    .0566038    .2312294          0          1
pres_qualm~y |       795    .0352201    .1844518          0          1
    pres_stv |       795    .0037736    .0613521          0          1
-------------+--------------------------------------------------------
pres_college |       795    .0251572    .1567011          0          1
      logmag |       780    1.300769    1.266935          0   5.010635
uppertier_~g |       626    8.788684     28.8885          0   415.1962
 logmag_eneg |       653    2.353421    2.800488          0   25.75041
proximity1~s |       790    .7497948    1.240595          0       6.57

. drop if enep_others>15 & enep_others<100;
(29 observations deleted)

. sum;

    Variable |       Obs        Mean    Std. Dev.       Min        Max
-------------+--------------------------------------------------------
     country |         0
countrynum~r |       766    98.18016    36.94863          3        199
        year |       766    1978.255      16.153       1946       2000
 institution |       766    1.673629    .8725347          1          3
     legelec |       766           1           0          1          1
-------------+--------------------------------------------------------
    preselec |       766    .1906005    .3930313          0          1
      regime |       766    .0182768     .134038          0          1
  regime_leg |       766           0           0          0          0
    eighties |       766    .0770235    .2668029          0          1
    nineties |       766    .1292428    .3356877          0          1
-------------+--------------------------------------------------------
         old |       766    .8733681    .3327774          0          1
      avemag |       753    11.00697    26.73715          1        150
   districts |       754    96.58621    144.5025          1        659
        eneg |       648    1.851634    1.155399   1.004012   14.22434
        enep |       727     3.90304    1.892247       1.23      14.89
-------------+--------------------------------------------------------
 enep_others |       726    1.972989    2.764791          0       14.7
       enep1 |       726    3.926618    1.928414       1.23      17.37
        enpp |       756    3.227698    1.477574          1      10.87
 enpp_others |       746    .9427614    2.950201          0       33.3
       enpp1 |       745    3.250604    1.520486          1       11.7
-------------+--------------------------------------------------------
      enpres |       761    1.142673    1.588175          0       6.57
      medmag |       617    12.49514    29.48294          1        150
      newdem |       766    .1409922    .3482409          0          1
  proximity1 |       766    .2662272    .4001552          0          1
  proximity2 |       766     .189295    .3919988          0          1
-------------+--------------------------------------------------------
       seats |       761    212.7766    165.2849         11        672
  upperseats |       723    15.30152     45.9748          0        344
   uppertier |       723     5.82888    12.72061          0      77.95
twoelections |       766    .0234987      .15158          0          1
twoelectio~1 |       766    .0117493    .1078261          0          1
-------------+--------------------------------------------------------
pres_plura~y |       766    .0704961    .2561485          0          1
 pres_runoff |       766    .2062663    .4048883          0          1
pres_major~y |       766    .0535248    .2252246          0          1
pres_qualm~y |       766    .0365535    .1877855          0          1
    pres_stv |       766    .0039164    .0624997          0          1
-------------+--------------------------------------------------------
pres_college |       766    .0261097    .1595656          0          1
      logmag |       753    1.338438    1.269949          0   5.010635
uppertier_~g |       606    8.565726    28.78322          0   415.1962
 logmag_eneg |       635    2.395093    2.817668          0   25.75041
proximity1~s |       761    .7427174    1.233463          0       6.57

. *     ****************************************************************  *;
. *       This drops 29 elections.  However, only 18 of these have        *;
. *       complete data on all of the variables.  There would have been   *;
. *       621 observations in the pooled model, but now there are only    *;
. *       603. Thus, I am dropping 2.9% of the sample.                    *;
. *     ****************************************************************  *;
.               *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *               So, now let's run stuff                                 *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
.   replace year=. if twoelections1==1;
(9 real changes made, 9 to missing)

. sort country year;

. tsset countrynumber year, yearly;
       panel variable:  countrynumber, 3 to 199
        time variable:  year, 1946 to 2000, but with gaps

. *     ****************************************************************  *;
. *           XTPCSE without lagged dependent variable                    *;
. *     ****************************************************************  *;
. xtpcse enep1 proximity1 enpres  proximity1_enpres  eneg logmag  logmag_eneg, pairwise;

Number of gaps in sample:  483
(note: at least one disturbance covariance assumed 0, no common time periods
       between panels)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable:   countrynumber                 Number of obs      =       597
Time variable:    year                          Number of groups   =        84
Panels:           correlated (unbalanced)       Obs per group: min =         1
Autocorrelation:  no autocorrelation                           avg =  7.107143
Sigma computed by pairwise selection                           max =        28
Estimated covariances      =      3570          R-squared          =    0.2507
Estimated autocorrelations =         0          Wald chi2(6)       =    185.56
Estimated coefficients     =         7          Prob > chi2        =    0.0000

------------------------------------------------------------------------------
             |           Panel-corrected
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  proximity1 |  -3.523821   .4538364    -7.76   0.000    -4.413324   -2.634318
      enpres |    .336561   .0886608     3.80   0.000     .1627891    .5103329
proximity1~s |    .835159   .1934977     4.32   0.000     .4559105    1.214408
        eneg |    .131613   .0822625     1.60   0.110    -.0296186    .2928446
      logmag |   .4431823   .1223161     3.62   0.000     .2034471    .6829175
 logmag_eneg |   .0008841   .0722254     0.01   0.990     -.140675    .1424432
       _cons |   3.096536   .1698406    18.23   0.000     2.763655    3.429418
------------------------------------------------------------------------------

. xtpcse enep1 proximity1 enpres  proximity1_enpres eneg logmag  logmag_eneg if old==1, pairwise;

Number of gaps in sample:  443
(note: at least one disturbance covariance assumed 0, no common time periods
       between panels)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable:   countrynumber                 Number of obs      =       522
Time variable:    year                          Number of groups   =        51
Panels:           correlated (unbalanced)       Obs per group: min =         1
Autocorrelation:  no autocorrelation                           avg =  10.23529
Sigma computed by pairwise selection                           max =        28
Estimated covariances      =      1326          R-squared          =    0.3334
Estimated autocorrelations =         0          Wald chi2(6)       =    305.54
Estimated coefficients     =         7          Prob > chi2        =    0.0000

------------------------------------------------------------------------------
             |           Panel-corrected
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
  proximity1 |  -3.442804   .4261206    -8.08   0.000    -4.277985   -2.607623
      enpres |   .2957031   .0736218     4.02   0.000      .151407    .4399992
proximity1~s |   .8190867   .1717269     4.77   0.000     .4825082    1.155665
        eneg |   .1041911   .0808775     1.29   0.198    -.0543259    .2627082
      logmag |  -.0338597    .102583    -0.33   0.741    -.2349186    .1671992
 logmag_eneg |   .3428988   .0707301     4.85   0.000     .2042704    .4815272
       _cons |   2.983333   .1627729    18.33   0.000     2.664304    3.302362
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *           XTPCSE with lagged dependent variable                       *;
. *     ****************************************************************  *;
. sort country year;

. by country: generate enep1_lag=enep1[_n-1];
(140 missing values generated)

. replace enep1_lag = . if newdem==1;
(21 real changes made, 21 to missing)

. set matsize 150;

. xtpcse enep1 enep1_lag proximity1 enpres  proximity1_enpres  eneg  logmag logmag_eneg, pairwise;

Number of gaps in sample:  401
(note: at least one disturbance covariance assumed 0, no common time periods
       between panels)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable:   countrynumber                 Number of obs      =       497
Time variable:    year                          Number of groups   =        70
Panels:           correlated (unbalanced)       Obs per group: min =         1
Autocorrelation:  no autocorrelation                           avg =       7.1
Sigma computed by pairwise selection                           max =        27
Estimated covariances      =      2485          R-squared          =    0.6983
Estimated autocorrelations =         0          Wald chi2(7)       =    487.97
Estimated coefficients     =         8          Prob > chi2        =    0.0000

------------------------------------------------------------------------------
             |           Panel-corrected
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   enep1_lag |   .7831768   .0519349    15.08   0.000     .6813863    .8849673
  proximity1 |  -.7775263   .4580673    -1.70   0.090    -1.675322    .1202692
      enpres |   .0856857    .058069     1.48   0.140    -.0281275    .1994989
proximity1~s |   .1504264   .1967661     0.76   0.445     -.235228    .5360809
        eneg |   .1417898   .0583748     2.43   0.015     .0273774    .2562023
      logmag |   .1006776   .1086749     0.93   0.354    -.1123213    .3136765
 logmag_eneg |    .023474   .0590192     0.40   0.691    -.0922016    .1391496
       _cons |   .4993553   .2001592     2.49   0.013     .1070504    .8916601
------------------------------------------------------------------------------

. xtpcse enep1 enep1_lag proximity1 enpres  proximity1_enpres  eneg  logmag logmag_eneg if old==1,pair
> wise;

Number of gaps in sample:  387
(note: at least one disturbance covariance assumed 0, no common time periods
       between panels)

Linear regression, correlated panels corrected standard errors (PCSEs)

Group variable:   countrynumber                 Number of obs      =       457
Time variable:    year                          Number of groups   =        45
Panels:           correlated (unbalanced)       Obs per group: min =         1
Autocorrelation:  no autocorrelation                           avg =  10.15556
Sigma computed by pairwise selection                           max =        27
Estimated covariances      =      1035          R-squared          =    0.7329
Estimated autocorrelations =         0          Wald chi2(7)       =    791.17
Estimated coefficients     =         8          Prob > chi2        =    0.0000

------------------------------------------------------------------------------
             |           Panel-corrected
             |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
-------------+----------------------------------------------------------------
   enep1_lag |   .7901974   .0527754    14.97   0.000     .6867596    .8936352
  proximity1 |  -.7535784   .4480685    -1.68   0.093    -1.631777    .1246197
      enpres |   .0977832   .0580864     1.68   0.092     -.016064    .2116304
proximity1~s |   .1179178   .1894649     0.62   0.534    -.2534266    .4892622
        eneg |   .1056241    .068631     1.54   0.124    -.0288901    .2401384
      logmag |  -.0018568    .092038    -0.02   0.984    -.1822479    .1785343
 logmag_eneg |   .1042487   .0596786     1.75   0.081    -.0127191    .2212165
       _cons |   .4877446   .1931358     2.53   0.012     .1092054    .8662837
------------------------------------------------------------------------------

. *     ****************************************************************  *;
. *     ****************************************************************  *;
. *                                   THE END                             *;
. *     ****************************************************************  *;
. *     ****************************************************************  *;
. exit;

end of do-file

.              log close
       log:  C:\DATA\electoral_xtpcse.log
  log type:  text
 closed on:  18 May 2005, 11:03:10
------------------------------------------------------------------------------------------------------
